/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package java1;

/**
 *
 * @author Yu
 */
public class Map2 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

	java.util.HashMap<String, Integer> map
		= new java.util.HashMap<>();
	map.put("1", 1);
	map.put("2", 2);
	map.put("3", 3);

	Integer a = map.get("3");
	System.out.println(a);

	java.util.Set<String> set = map.keySet();
	java.util.Iterator<String> keys = set.iterator();
	while (keys.hasNext()) {
	    String key = keys.next();
	    Integer value = map.get(key);
	    System.out.println(key + ":" + value);
	}

    }

}
